﻿using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Single.Npoi
{
    public class NpoiSetValueRow
    {
        public List<NpoiSetValueCell> Cells { get; set; }

        public void Add(int cellIndex, object cellValue, string cellType = null)
        {
            if (Cells == null)
            {
                Cells = new List<NpoiSetValueCell>();
            }

            Cells.Add(new NpoiSetValueCell
            {
                Index = cellIndex,
                Type = cellType ?? cellValue.GetType().Name,
                Value = cellValue
            });
        }
    }
}